package testfour;

import java.text.DecimalFormat;

public final class Telfee {
    private Telfee() {
    }
    public static String classify(final String a, final String b) {
        double telfee;
        final int minu1 = 20;
        final double money1 = 0.05;
        final double money2 = 1.00;
        final double money3 = 0.1;

        Telephone ht = new Telephone(a, b);
        DecimalFormat    df   = new DecimalFormat("######0.00");
        long minute = (ht.getTelephone());
        //计算话费
        if (minute <= minu1) {
            telfee = money1 * minute;
        } else {
            telfee = money2 + (minute - minu1) * money3;
        }
        return ("通话时间：" + minute + "分钟;") + ("通话话费：" + df.format(telfee) + "美元");
    }
}

